text: Make the placeholder non-intrusive
authorMatthias Clasen <mclasen@redhat.com>
Mon, 5 Jun 2023 01:45:59 +0000 (21:45 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 5 Jun 2023 01:47:11 +0000 (21:47 -0400)
We never want to let the placeholder cause
the widget to grow, so set its max-width-chars
to a small value to make it ellipsize.

gtk/gtktext.c

index 6682bf3d5eb0bed11f155978412b7c6da7a5d711..e4605a6970533a29f51def1294323168b2fda85b 100644 (file)
@@ -6725,6 +6725,7 @@ gtk_text_set_placeholder_text (GtkText    *self,
                                         "css-name", "placeholder",
                                         "xalign", priv->xalign,
                                         "ellipsize", PANGO_ELLIPSIZE_END,
+                                        "max-width-chars", 3,
                                         NULL);
       gtk_label_set_attributes (GTK_LABEL (priv->placeholder), priv->attrs);
       gtk_widget_insert_after (priv->placeholder, GTK_WIDGET (self), NULL);